import request from '@/utils/request'

// 获取审批流程列表
export function getFlowList(params) {
  return request({
    url: '/approval-flows/page',
    method: 'get',
    params
  })
}

// 获取审批流程详情
export function getFlowDetail(id) {
  return request({
    url: `/approval-flows/${id}`,
    method: 'get'
  })
}

// 创建审批流程
export function createFlow(data) {
  return request({
    url: '/approval-flows',
    method: 'post',
    data
  })
}

// 更新审批流程
export function updateFlow(data) {
  return request({
    url: '/approval-flows',
    method: 'put',
    data
  })
}

// 删除审批流程
export function deleteFlow(id) {
  return request({
    url: `/approval-flows/${id}`,
    method: 'delete'
  })
}

// 切换审批流程状态
export function toggleFlowStatus(id) {
  return request({
    url: `/approval-flows/${id}/toggle-status`,
    method: 'post'
  })
} 